package com.skyworth.ui.api;

import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.widget.FrameLayout;

import com.skyworth.util.SkyScreenParams;

/**
 * Created by lu on 2018/1/23.
 */

public class SkyBaseDialogView extends FrameLayout {

    public synchronized static final Drawable getBG(Context context) {
        Drawable contentBG;
        int roundRadius = SkyScreenParams.getInstence(context).getResolutionValue(6); //
        int fillColor = Color.parseColor("#b0b4b7");//内部填充颜色
        GradientDrawable gd = new GradientDrawable();//创建drawable
        gd.setColor(fillColor);
        gd.setCornerRadius(roundRadius);
        contentBG = gd;
        return contentBG;
    }

    protected Dialog dialog;

    public SkyBaseDialogView(@NonNull Context context) {
        super(context);
        init();
    }

    public SkyBaseDialogView(@NonNull Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    public SkyBaseDialogView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init();
    }

    public void setParentDialog(Dialog dialog) {
        this.dialog = dialog;
    }

    private void init() {
//        setBackground(getBG(getContext()));
    }

    public void show() {

    }

    public void dismiss() {

    }
}
